package com.sxpi.zixun.local;

import com.sxpi.zixun.pojo.AdminUser;
import com.sxpi.zixun.pojo.User;

/**
 * @Author: 董伟豪
 * @Date: 2022/6/10 15:56
 */
public class UserThreadLocal {
    // 实现一个threadlocal线程副本
    static ThreadLocal<AdminUser> userThreadLocal = new ThreadLocal<>();

    // 添加
    public static void put(AdminUser isFlag) {
        userThreadLocal.set(isFlag);
    }

    // 获取
    public static AdminUser get() {
        return userThreadLocal.get();
    }

    // 删除
    public static void remove() {
        userThreadLocal.remove();
    }
}
